package org.omg.GIOP;

//
// Helper class for : AddressingDisposition
//
// @author OpenORB Compiler
//
public class AddressingDispositionHelper
{
	//
	// Insert AddressingDisposition into an any
	// @param	a an any
	// @param	t AddressingDisposition value
	//
	public static void insert( org.omg.CORBA.Any a, short t )
	{
		a.type( type() );
		write(a.create_output_stream(),t);
	}

	//
	// Extract AddressingDisposition from an any
	// @param	a an any
	// @return the extracted AddressingDisposition value
	//
	public static short extract( org.omg.CORBA.Any a )
	{
		if ( !a.type().equal( type() ) )
			throw new org.omg.CORBA.MARSHAL();
		return read(a.create_input_stream());
	}

	//
	// Internal TypeCode value
	//
	private static org.omg.CORBA.TypeCode _tc = null;

	//
	// Return the AddressingDisposition TypeCode
	// @return a TypeCode
	//
	public static org.omg.CORBA.TypeCode type()
	{
		if ( _tc == null ) {
			org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
			_tc = orb.create_alias_tc(id(),"AddressingDisposition",orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_short));
		}
		return _tc;
	}

	//
	// Return the AddressingDisposition IDL ID
	// @return an ID
	//
	public static String id()
	{
		return _id;
	}

	private final static String _id = "IDL:omg.org/GIOP/AddressingDisposition:1.0";

	//
	// Read AddressingDisposition from a marshalled stream
	// @param	istream the input stream
	// @return the readed AddressingDisposition value
	//
	public static short read( org.omg.CORBA.portable.InputStream istream )
	{
		short new_one;
		new_one = istream.read_short();

		return new_one;
	}

	//
	// Write AddressingDisposition into a marshalled stream
	// @param	ostream the output stream
	// @param	value AddressingDisposition value
	//
	public static void write( org.omg.CORBA.portable.OutputStream ostream, short value )
	{
		ostream.write_short(value);
	}

}
